<?php
require_once("includes/prepend.php");
require_once("includes/lifesubnav.php");
?>

<?php
date_default_timezone_set("Asia/Shanghai");
$yesterdayTime = date("Y-m-d",time()-60*60*24);
$tommorrowTime = date("Y-m-d",time()+60*60*24);
$skind=$page->sKind;
$zkind=$page->zKind;
?>	
<div id="maincontent"><!--start maincontent-->
	<div id="friendviewcontent"><!--start friendviewcontent-->
	  <div id="financesearch"><!--start search-->
	  	<select name="searchfangxiang" id="searchfangxiang" class="financeinput" style="float:left;" onclick = "searchdisplaykinds()"><option value="all">所有方向</option><option value="0">支出</option><option value="1">收入</option></select>
		<select name ="searchformskinds" id="searchformskinds" style="display:none;" >
		<option value="all">所有种类</option>
		<?php
			foreach($skind as $values){
			echo "<option type='button' value ='$values'>$values</option>";
			}
		?>
		</select>
		<select name ="searchformzkinds" id="searchformzkinds" style="display:none;" >
		<option value="all">所有种类</option>
		<?php
			foreach($zkind as $values){
			echo "<option type='button' value ='$values'>$values</option>";
			}
		?>
		</select>
		<div style="float:left;width:600px;">
		<input name="startdate" id="startdate" class="date_input" style ='width:100px;' type="text" value="<?php echo $yesterdayTime;?>" />至
	  	<input name="enddate" id="enddate" class="date_input" style ='width:100px;' type="text" value="<?php echo $tommorrowTime;?>" />
	  	<input type="button" value="查询" onclick="financesearch()" />
		</div>
	  	<div id="financesearchResult" ></div>
	  </div><!--end search-->
	  <div id="financeadd">
	  	<div id="displaymesarea"></div>
		<h3 class="financeh3">项目添加</h3>
		<ul id="financeul">
			<li>项目方向：<select name="fangxiang" id="fangxiang" class="financeinput" onclick = "displaykinds()"><option value="0">支出</option><option value="1">收入</option></select></li>
			<div style="clear:both;"></div>
			<li>种类：<input type="text" name="kind" id="kind" onfocus = "displaykinds()" /><span style='color:red;font-size:16px;'> *</span></li>
			<div id="financeskinds" style="display:none;">
			<?php
			echo "收入种类:";
			if (!empty($skind)){
				foreach($skind as $values){
				echo "<input type='button' value ='$values' onclick = financegetkinds(this.value) style ='margin-left:2px;font-size:12px;' />";
				}
			}
			?>
			</div>
			<div id="financezkinds" style="display:none;">
			<?php
			echo "支出种类：";
			if (!empty($zkind)){
				foreach($zkind as $values){
				echo "<input type='button' value ='$values' onclick = financegetkinds(this.value) style = margin-left:2px;font-size:12px;' />";
				}
			}
			?>
			</div>
			<div style="clear:both;"></div>
			<li>标题：<input type="text" name="title" id="title" /><span style='color:red;font-size:16px;'> *</span></li>
			<li>金额：<input type="text" name="quantity" id="quantity" />￥</li>
			<div style="clear:both;"></div>
			<li>备注：<input type="text" name="beizhu" id="beizhu" /></li>
			<div style="clear:both;"></div>
			<li><input type="button" class="fininputbutton" value="新增" onclick="makeConfirm()"></li>
		</ul>
	  </div><!--end financeadd-->
	  <div id = "financeinfothis">
	  	<h3 class="financeh3">财务信息</h3>
	  	<?php
	  	$zhiChu = $page->zhiChu;
	  	$shouRu = $page->shouRu;
	  	$yuE = $page->yuE;
	  	?>
	  	<div class="financeinfoiterm">个人总支出：<input id="finacezongzhichu" value="<?php echo $zhiChu ?>" onfocus="cannotchangefocus(this)" onblur="cannotchangeblur(this)" />￥</div>
	  	<div class="financeinfoiterm">个人总收入：<input id="finacezongshouru" value="<?php echo $shouRu ?>" onfocus="cannotchangefocus(this)" onblur="cannotchangeblur(this)" />￥</div>
	  	<div class="financeinfoiterm">个人总余额：<input id="finacezongyue" value="<?php echo $yuE ?>" onfocus="cannotchangefocus(this)" onblur="cannotchangeblur(this)" />￥</div>
	  </div>
	</div><!--end friendviewcontent-->
	
</div><!--end maincontent-->

<?php require_once("includes/pagefoot.php");
